<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="../css/style.css"/>
		<link rel="stylesheet" type="text/css" href="../css/header.css"/>
		<link rel="stylesheet" type="text/css" href="../css/land.css"/>
		<script src="../js/flexible.debug.js" type="text/javascript" charset="utf-8"></script>
		<!--<script src="../js/flexible_css.debug.js" type="text/javascript" charset="utf-8"></script>-->
	</head>
	<body>
		<header class="header">
			<span class="span fanghui"><img src="../img/fanhui.png"/></span>
			<span class="span">登录</span>
			<span class="span"></span>
		</header>
		<main class="main">
			<section class="section">
				<ul>
					<li><div><img src="../img/name.png"/></div><input id="phone" type="text" name="" placeholder="邮箱账号或手机号"/></li>
					<li><div><img src="../img/password.png"/></div><input id="pas" type="text" name="" placeholder="密码"/></li>
				</ul>
				<a class="denglu">登录</a>
				<a href="register.html">注册</a>
				<p>你还可以选择其他方式登录:</p>
				<section class="qitadl">
					<span><a href="https://api.weibo.com/oauth2/authorize?client_id=3023520088&response_type=code&redirect_uri=http://www.nowcoder.com/oauth2/sinaconfig?callBack=https%3A%2F%2Fwww.nowcoder.com%2Fprofile%2F1948787&state=web&scope=follow_app_official_microblog"><img src="../img/xinlangwb.png"/></a><b>新浪微博登录</b></span>
					<span><a href="https://graph.qq.com/oauth/show?which=Login&display=pc&response_type=code&client_id=100270989&redirect_uri=https%3A%2F%2Fpassport.csdn.net%2Faccount%2Flogin%3Foauth_provider%3DQQProvider&state=test"><img src="../img/tengxuenQQ.png"/></a><b>QQ账号登录</b></span>
				</section>
			</section>
		</main>

		<script src="../js/jquery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function($){
				
//				$(".fanghui").click(function  () {
//				location.href="mine.html";
//			})
				
				$(".denglu").click(function(e){
				var	phone =$("#phone").val();
				var	psd =$("#pas").val();
					$.ajax({
					type:"post",
					data:{
						"user":phone,
						"pasword":psd,
					},
					url:"http://172.16.24.158:8080/login",
					async:true,
					success:function(data){
						console.log(data)
						$.each(data, function(i,n) {
							admin =	n.user;
							pass = n.pas;
						});
						if(phone==admin&&psd==pass){
							location.href = "mine.html";
							
						}else{
							alert("账号密码错误");
						}
						
						
					}
				});
					
				})
				
			})
			
		</script>

		
		

	</body>
</html>
